//
//  TFCommonPhrasesCollectionViewCell.swift
//  TalkfunSDKDemo
//
//  Created by 莫瑞权 on 2022/5/6.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

class TFCommonPhrasesCollectionViewCell: UICollectionViewCell {
    @objc public var myBlock:TF1to16ExpressionCellmyBlock?
    @objc public let btn = UIButton()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.backgroundColor = UIColor.clear

        
        self.btn.layer.borderColor = UIColor(red: 109/255.0, green: 130/255.0, blue: 158/255.0, alpha: 1).cgColor
        self.btn.layer.borderWidth = 0.5
        self.btn.layer.cornerRadius = 22.5
        self.addSubview(self.btn)
        self.btn.addTarget(self, action: #selector(self.btnClick), for: .touchUpInside)
        self.btn.setTitleColor(UIColor(red: 109/255.0, green: 130/255.0, blue: 158/255.0, alpha: 1), for: .normal)
       
        self.btn.titleLabel!.font = UIFont.PingFang(size: 16)
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        self.btn.frame = self.bounds
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    @objc func btnClick(_ btn:UIButton)
    {
        
        if (self.myBlock != nil) {
            let name = btn.titleLabel!.text
           
            self.myBlock!(name!);
        }
    }
}
